﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using GameLogic.Logic;

namespace GameLogic.Controls
{
    public class AboutControl : Control
    {
        public AboutControl()
        {
            this.DefaultStyleKey = typeof(AboutControl);
        }

        public const string C_GameNameTextBlockName = "_gameName";
        public const string C_DeveloperNameTextBlockName = "_developerName";
        public const string C_CompanyTextBlockName = "_companyName";

        TextBlock _gameName;
        TextBlock _developerName;
        TextBlock _companyName;

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (DesignerProperties.IsInDesignTool)
            {
                return;
            }

            _gameName = GetTemplateChild(C_GameNameTextBlockName) as TextBlock;
            _developerName = GetTemplateChild(C_DeveloperNameTextBlockName) as TextBlock;
            _companyName = GetTemplateChild(C_CompanyTextBlockName) as TextBlock;

            this.DataContext = Storage.Instance;

            //_gameName.Text = Storage.GameName;
            //_developerName.Text = Storage.DeveloperName;
            //_companyName.Text = Storage.CompanyName;
        }
    }
}
